SDEF
// Crawler def file
// Model, animation, def file, stuff, by Boon

// SINED SECTION
//
/*SINED Monster_Crawler (1 .5 0) (0 0 0) (0 0 0)
Crawler
*/
//

path models/crawler

origin -12 0 0
scale 1

// Base model and skins
crawler_base.sbm

normal crawler_04a.tga
damage crawler_damage_04a.tga

// Normal Animations
aim			spit_aim.sam
fire			spit_fire.sam
walk			walk.sam
run			run.sam
idle			idle.sam
twitch		idle.sam
crouch_down			idle.sam
crouch_idle			idle.sam
readyfire		spit_aim.sam
//melee1			grunt_punch1.sam
jump1				jump.sam
land1				land.sam
ceilingjump			jump.sam
holdceilingjump		post_jump.sam

//alert			idle.sam

// used while running away to hide
sprint			sprint.sam

// Pain Location Based Animations
pain1				pain.sam

pain_head			pain.sam
pain_torso			pain.sam
pain_left_arm_upper	pain_left_arm.sam
pain_left_arm_lower	pain_left_arm.sam
pain_left_leg_upper	pain_left_leg.sam
pain_left_leg_lower	pain_left_leg.sam
pain_right_arm_upper	pain_right_arm.sam
pain_right_arm_lower	pain_right_arm.sam
pain_right_leg_upper	pain_right_leg.sam
pain_right_leg_lower	pain_right_leg.sam

// Death Location based Animations
death1		death.sam

fall1				fall.sam
step_left			strafe_left.sam
step_right			strafe_right.sam

// Crouching Location Based Animations
// The crawler has none of these

// Ceiling Animations
ceiling_idle		idle_ceiling.sam
ceiling_twitch		idle_ceiling.sam
ceiling_walk		walk_ceiling.sam
ceiling_aim			spit_aim_ceiling.sam
ceiling_fire		spit_fire_ceiling.sam
ceiling_readyfire		spit_aim_ceiling.sam
//ceiling_pain		fall.sam
ceiling_pain		pain_ceiling.sam
ceiling_step_left		strafe_left_ceiling.sam
ceiling_step_right	strafe_right_ceiling.sam

//ceiling_idle		idle.sam
//ceiling_twitch		idle.sam
//ceiling_walk		walk.sam
//ceiling_aim			spit_aim.sam
//ceiling_fire		spit_fire.sam
//ceiling_readyfire		spit_aim.sam
//ceiling_pain		apin.sam
//ceiling_step_left		strafe_left.sam
//ceiling_step_right	strafe_right.sam

//getup.sam
//jump_again.sam
//jump.sam
//land.sam
//pickup.sam
//turn.sam


// Id And Group Definitions
id 5 group head flesh
group head damage 3.0
id 10 group torso metal
group torso damage 0.2
id 20 group left_arm_upper flesh
group left_arm_upper  damage 0.8
id 25 group left_arm_lower flesh
group left_arm_lower  damage 0.5
id 30 group right_arm_upper flesh
group right_arm_upper damage 0.8
id 35 group right_arm_lower flesh
group right_arm_lower damage 0.5
id 40 group left_leg_upper flesh
group left_leg_upper  damage 0.8
id 45 group left_leg_lower flesh
group left_leg_lower  damage 0.5
id 50 group right_leg_upper flesh
group right_leg_upper damage 0.8
id 55 group right_leg_lower flesh
group right_leg_lower damage 0.5
id 200 group head bone gun 0 180 0 flesh



//
// INITIALIZATION SECTION
//
!init:
//
// SERVER Initialization Commands
//
// Class Setup
server classname crawler
//server setsize "-22 -22 -20" "22 22 24"
//server crouchsize "-22 -22 -20" "22 22 24"
server setsize "-16 -16 0" "16 16 40"
server crouchsize "-16 -16 0" "16 16 40"
server script global/crawler.scr
//server script global/enemy.scr
server weapon CrawlerWeapon
server health 80
server ifskill 2 health 200
server meleerange 150
//server meleedamage 10
server painthreshold 15
//server //shotsperattack 2
server fov 180


//
// Sound Aliases
server aliascache  snd_attacktaunt1    "monsters/crawler/attk1.wav" 1
server aliascache  snd_attacktaunt2    "monsters/crawler/attk2.wav" 1
server aliascache  snd_attacktaunt3    "monsters/crawler/attk3.wav" 1

server aliascache  snd_pursuit1    "monsters/crawler/purs1.wav" 1
server aliascache  snd_pursuit2    "monsters/crawler/purs2.wav" 1

server aliascache  snd_sightenemy1    "monsters/crawler/site1.wav" 1
server aliascache  snd_sightenemy2    "monsters/crawler/site2.wav" 1
server aliascache  snd_sightenemy3    "monsters/crawler/site3.wav" 1


server aliascache  snd_inmysights1    "monsters/crawler/site1.wav" 1
server aliascache  snd_inmysights2    "monsters/crawler/site2.wav" 1
server aliascache  snd_inmysights3    "monsters/crawler/site3.wav" 1

server aliascache  snd_idle1          "monsters/crawler/idle1.wav"  1
server aliascache  snd_idle2          "monsters/crawler/idle2.wav"  1
server aliascache  snd_idle3          "monsters/crawler/idle3.wav"  1

server aliascache  snd_investigate1   "monsters/crawler/idle4.wav" 1
server aliascache  snd_locate1        "monsters/crawler/idle5.wav" 1

//server aliascache  snd_tauntdeath1    "monsters/crawler/taunt1.wav" 1
//server aliascache  snd_tauntdeath2    "monsters/crawler/taunt2.wav" 1
//server aliascache  snd_tauntdeath3    "monsters/crawler/taunt3.wav" 1
//server aliascache  snd_tauntdeath4    "monsters/crawler/taunt4.wav" 1

//server aliascache snd_lostweapon "monsters/crawler/painhnd.wav" 1


//
// CLIENT Initialization Commands
//
// Sound Aliases

client aliascache  snd_pain1     "monsters/crawler/pain1.wav" 1
client aliascache  snd_pain2     "monsters/crawler/pain2.wav" 1
client aliascache  snd_pain3     "monsters/crawler/pain3.wav" 1
client aliascache  snd_pain4     "monsters/crawler/pain4.wav" 1
client aliascache  snd_pain5     "monsters/crawler/pain5.wav" 1

client aliascache  snd_death1    "monsters/crawler/death1.wav" 1
client aliascache  snd_death2    "monsters/crawler/death2.wav" 1
client aliascache  snd_shrivel    "monsters/crawler/deathp2.wav" 1

client aliascache  snd_kneefall1   "impact/bodyfall/sml1.wav" 1
client aliascache  snd_kneefall2   "impact/bodyfall/sml2.wav" 1
client aliascache  snd_partfall1   "impact/bodyfall/med1.wav" 1
client aliascache  snd_partfall2   "impact/bodyfall/med2.wav" 1
client aliascache  snd_partfall3   "impact/bodyfall/med3.wav" 1
client aliascache  snd_bodyfall1   "impact/bodyfall/lrg1.wav" 1
client aliascache  snd_bodyfall2   "impact/bodyfall/lrg2.wav" 1
client aliascache  snd_whoosh1     "weapons/punch/whsh1.wav" 1
client aliascache  snd_whoosh2     "weapons/punch/whsh2.wav" 1
client aliascache  snd_step1      "monsters/crawler/step/1.wav" 1
client aliascache  snd_step2      "monsters/crawler/step/2.wav" 1
client aliascache  snd_step3      "monsters/crawler/step/3.wav" 1
client aliascache  snd_step4      "monsters/crawler/step/4.wav" 1
client aliascache  snd_drag1      "monsters/crawler/drag.wav" 1


// -----------------------------------------------------------------------------
// MAIN SECTION
//
!main:
//server jump   3  nextframe 3

//server land   first setframe 4
// Special Commands
//server crouch_down  last  nextanim crouch_idle

server ceilingjump last orienttoceiling
server ceilingjump last nextanim holdceilingjump
server holdceilingjump 4 nextframe 4

// Normal Animations
server walk      0 movementsound
//server walk      3 movementsound
server walk      7 movementsound
//server walk      11 movementsound
client walk      0 randomsound snd_step .3
//client walk      3 randomsound snd_step .3
client walk      7 randomsound snd_step .3
//client walk      11 randomsound snd_step .3


server run       2 movementsound
server run       5 movementsound
client run       2 randomsound snd_step .5
client run       5 randomsound snd_step .5

//server turn       3 movementsound
//server turn       7 movementsound
//server turn       9 movementsound
//client turn       3 randomsound snd_step .3
//client turn       7 randomsound snd_step .3
//client turn       9 randomsound snd_step .3

server fall1       16 movementsound
client fall1       16 randomsound snd_partfall 1
client fall1       16 randomsound snd_step 1

server land1       1 movementsound
client land1       1 randomsound snd_partfall 1
client land1       1 randomsound snd_step 1

//server pickup       3 movementsound
//client pickup       3 randomsound snd_drag 1

//server jump_again       11 movementsound
//client jump_again       11 randomsound snd_step 1
//client jump_again       12 randomsound snd_step 1

//server setup       6 movementsound
//client setup       6 randomsound snd_step .5
//client setup       7 randomsound snd_step .5
//client setup       8 randomsound snd_step .5
//client setup       9 randomsound snd_step .5

// Pain Location Based Animations
server pain1 first painsound
client pain1 first randomsound snd_pain 1 2
server pain_left_arm_upper first painsound
client pain_left_arm_upper first randomsound snd_pain 1 2
server pain_left_arm_lower first painsound
client pain_left_arm_lower first randomsound snd_pain 1 2
server pain_right_arm_upper first painsound
client pain_right_arm_upper first randomsound snd_pain 1 2
server pain_right_arm_lower first painsound
client pain_right_arm_lower first randomsound snd_pain 1 2
server pain_left_leg_upper first painsound
client pain_left_leg_upper first randomsound snd_pain 1 2
server pain_left_leg_lower first painsound
client pain_left_leg_lower first randomsound snd_pain 1 2
server pain_right_leg_upper first painsound
client pain_right_leg_upper first randomsound snd_pain 1 2
server pain_right_leg_lower first painsound
client pain_right_leg_lower first randomsound snd_pain 1 2

server death1 first deathsound
client death1 first randomsound snd_death 1 2
client death1 15 randomsound snd_shrivel 1 2

server fire 0 movementsound
client fire 0 randomsound snd_run 1
client fire 2 randomsound snd_run 1
server fire 1 fire

server ceiling_fire 0 movementsound
client ceiling_fire 0 randomsound snd_run 1
client ceiling_fire 2 randomsound snd_run 1
server ceiling_fire 1 fire
